* This file contains the code and references to the data files to reproduce
* the analysis that appears in Table 1 of the paper. Users should set their
* working directory in such a way that it calls the files from this folder.

* For example, pwd to see current directory, and cd "~/WarData" to change
* working directory.



/*Initial setup*/

set more off



/*Models for Table 1*/

/*HOUSE*/
use "HOUSE81_109_corrCQ&votetypeII.dta"

probit pres_supp war  day30_change rally pres_app id_dis_1 foreignFirst MIPx30day if pure_procedure!=1, cluster(cong)
est store m1
probit pres_supp war  day30_change rally pres_app id_dis_1 foreignFirst MIPx30day if pure_procedure!=1 & war==1, cluster(cong)
est store m2


/*SENATE*/
use "81-109 with votetypeII.dta", clear

probit pres_supp war  day30_change rally pres_app id_dis_1 foreignFirst MIPx30day nomination treaty if pure_procedure!=1, cluster(cong)
est store n1
probit pres_supp war  day30_change rally pres_app id_dis_1 foreignFirst MIPx30day  nomination treaty if pure_procedure!=1 & war==1, cluster(cong)
est store n2

/*Table Output for LaTeX/Paper*/
esttab m1 m2 n1 n2 using  "~/Table1.tex", ///
replace se(3) booktabs label b(3) star(+ 0.10 * 0.05 ** 0.01 *** 0.001) nonumbers pr2 aic compress ///
addnotes( "Omitted variables are due to a comparatively small number of cases that perfectly predict the outcome." "\sym{+} \(p<0.10\), \sym{*} \(p<0.05\), \sym{**} \(p<0.01\), \sym{***} \(p<0.001\) (two-tailed). Clustered standard errors in parentheses.") nonotes ///
title(Impact of War on Support of the President's Position (Roll Call)) order( war day30_change foreignFirst MIPx30day  rally pres_app id_dis_1) ///
mgroups(House Senate, pattern(1 0 1 0)) mtitle("All Votes"  "Wartime" "All Votes"  "Wartime") alignment(D{.}{.}{-1})

